﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WPFHelpers;

namespace Tourbook.Riders
{
    public class RiderViewModel : ObservableObject
    {
        #region Members and ctors

        private RiderModel mRider;       

        public RiderViewModel()
        {
            mRider = new RiderModel();
        }

        #endregion

        #region Properties

        public string FirstName
        {
            get
            {
                return mRider.FirstName;
            }
            set
            {
                if (!String.Equals(value, mRider.FirstName, StringComparison.Ordinal))
                {
                    mRider.FirstName = value;
                    OnPropertyChanged("FirstName");
                }
            }
        }

        public string LastName
        {
            get
            {
                return mRider.LastName;
            }
            set
            {
                if (!String.Equals(value, mRider.FirstName, StringComparison.Ordinal))
                {
                    mRider.LastName = value;
                    OnPropertyChanged("LastName");
                }
            }
        }

        public string Email
        {
            get
            {
                return mRider.Email;
            }
            set
            {
                if (!String.Equals(value, mRider.Email, StringComparison.Ordinal))
                {
                    mRider.Email = value;
                    OnPropertyChanged("Email");
                }
            }
        }

        internal RiderModel OriginalModel
        {
            get
            {
                return mRider;
            }
        }

        #endregion
    }
}
